Controlling variation of valid data counts in garbage collection source blocks

ABSTRACT

A subset of blocks from a set of blocks of a memory device are identified based on a valid data count constraint. A first block from the subset of blocks is selected based on a valid data count of the first block. A second block from the subset of blocks is selected based on a data temperature of the second block. A comparison of the first block and the second block is performed in accordance with one or more comparison criterion. The first block or the second block is selected as a garbage collection source block based on the comparison. Garbage collection is performed at the garbage collection source block.

TECHNICAL FIELD

Embodiments of the disclosure relate generally to memory sub-systems andmore specifically to controlling variation of valid data counts ingarbage collection source blocks of a memory sub-system.

BACKGROUND

A memory sub-system can include one or more memory devices that storedata. The memory devices can be, for example, non-volatile memorydevices and volatile memory devices. In general, a host system canutilize a memory sub-system to store data at the memory devices and toretrieve data from the memory devices.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will be understood more fully from the detaileddescription given below and from the accompanying drawings of variousembodiments of the disclosure.

FIG. 1 is a block diagram illustrating an example computing system thatincludes a memory sub-system, in accordance with some embodiments of thepresent disclosure.

FIGS. 2A and 2B are conceptual diagrams illustrating exampleinteractions between components of the memory sub-system in performing amethod for selecting a garbage collection source block to controlvariation in valid data counts, in accordance with some embodiments ofthe present disclosure.

FIGS. 3 and 4 are flow diagrams illustrating a method for selecting agarbage collection source block that controls variation in valid datacounts, in accordance with some embodiments of the present disclosure.

FIG. 5 is a flow diagram illustrating a method for selecting a garbagecollection source block that controls variation in valid data counts, inaccordance with some embodiments of the present disclosure.

FIG. 6 is a block diagram of an example computer system in whichembodiments of the present disclosure may operate.

DETAILED DESCRIPTION

Aspects of the present disclosure are directed to controlling variationof valid data counts (VDC) in garbage collection source blocks in amemory sub-system. A memory sub-system can be a storage device (e.g.,solid-state drive (SSD)), a memory module, or a combination of a storagedevice and memory module. Examples of other storage devices and memorymodules are described below in conjunction with FIG. 1 . In general, ahost system can utilize a memory sub-system that includes one or morecomponents, such as memory devices that store data. The host system canprovide data to be stored at the memory sub-system and can request datato be retrieved from the memory sub-system.

A memory device can be a non-volatile memory device. One example ofnon-volatile memory devices is a negative-and (NAND) memory device.Other examples of non-volatile memory devices are described below inconjunction with FIG. 1 . Each of the non-volatile memory devices caninclude one or more arrays of memory cells. A memory cell (“cell”) is anelectronic circuit that stores information. Depending on the cell type,a cell can store one or more bits of binary information, and has variouslogic states that correlate to the number of bits being stored. Thelogic states can be represented by binary values, such as “0” and “1”,or combinations of such values.

Various memory access operations can be performed on the memory cells.Data can be written to, read from, and erased from memory cells. Memorycells can be grouped into a write unit, such as a page. For some typesof memory devices, a page is the smallest write unit. A page sizerepresents a particular number of cells of a page. For some types ofmemory devices (e.g., NAND), memory cells can be grouped into an eraseunit, such as a physical block, which is a group of pages. A physicalblock is a 2-dimensional memory array of pages (rows of cells) andstrings (columns of cells). Data can be written to a block,page-by-page. Data can be erased at a block level. However, portions ofa block cannot be erased.

Garbage collection is a process performed at memory devices to improvewrite performance. In general, the goal of garbage collection is tooptimize space and improve efficiency of a memory device by keeping asmany empty blocks as possible so that the memory device does not have towait for a block to be erased before performing a write operation. As anexample, when a host system is to write new data to a used block of amemory device, pages in the block with stale data cannot be used untilthey are erased, though as mentioned above, data is erased at the blocklevel and not at the page level. As an additional challenge tomanagement of the memory device, a block with pages that contain staledata may include a number of pages that contain valid data, which isreferred to as the VDC of the block. To be able to use the pages withthe stale data, garbage collection is performed. With garbagecollection, pages containing valid data have to be copied to an emptyblock, and the previous block is completely erased before being able tobe used. More specifically, garbage collection includes copying allpages with valid data to an empty block, updating a logical blockaddress (LBA) with the new location, erasing the block including thepages with stale data, and adding the block to a free block pool. Thisconstant shifting of data can result in many more program/erase (P/E)cycles than requested by the host system, a situation referred to aswrite amplification.

The block to be erased after valid data is moved to a new block isreferred to as the “garbage collection source block.” In a first garbagecollection scheme, the garbage collection source block is the block withthe lowest VDC. This scheme is often referred to as the “greedy VDCscheme” or “minimum VDC scheme.” A second garbage collection schemeseeks to reduce write amplification by identifying a “data temperature”of potential garbage collection source blocks and selecting an optimumblock based on VDC and the data temperature of the block. As usedherein, “data temperature” of a block refers to a frequency with whichdata stored by the block is updated. The selection criterion for theseschemes seeks to segregate “hot” data (data that is frequently updated),“cold” data (data that is infrequently updated) and data with variousother frequencies into different destination blocks to optimize the GCcollection rates of the blocks of different temperatures so that theoverall write amplification is reduced. This second scheme is alsoreferred to as a “2D-greedy scheme.”

Consistent performance is paramount for memory devices, so much so thatmanufacturing standards often specify minimum requirements for variationin performance. In performing garbage collection there can befluctuations in the amount of VDC in the garbage collection sourceblock. Existing mechanisms exist in memory devices to identify and tracka stable ratio of garbage collection to host writes for the dual purposeof maintaining performance consistency and availability of free space inthe memory device.

Unlike the greedy VDC scheme, the 2D-greedy scheme frequently compactscold data blocks with higher VDC to segregate cold data. This results ina higher fluctuation in VDC. Although memory devices have abilities totolerate fluctuations in the VDC, as discussed above, the amplitude andthe frequencies of the VDC deviations could overwhelm these abilities.

Aspects of the present disclosure address deficiencies of conventionalgarbage collection schemes with an approach to garbage collection sourceblock selection that limits both the amplitude and frequency of the VDCdeviations in garbage collection source blocks. Consistent with someembodiments, a garbage collection management component of a memorysub-system determines a VDC of each block in a memory device andidentifies blocks with a VDC that satisfy a VDC constraint (e.g., byhaving a VDC that is lower than a VDC threshold). From the identifiedblocks, the garbage collection management component selects a firstblock as a potential garbage collection source block using a firstgarbage collection scheme such as the greedy VDC scheme described above.The garbage collection management component selects a second block fromthe identified blocks as another potential garbage collection sourceblock using a second garbage collection scheme such as the 2D greedy VDCscheme described above. The garbage collection management componentcompares the first block and second block and selects one of the blocksas the garbage collection source block based on one or more comparisoncriterion. Garbage collection is then performed in accordance with thegarbage collection source block selection by the garbage collectionmanagement component.

For some embodiments, the garbage collection management component tracksmultiple garbage collection source block selections (e.g., selections ofblocks with a VDC within a predetermined range of the minimum VDC in thememory device) and generates historical log data based thereon. Thegarbage collection management component can use the historical log datato select a garbage collection source block. For example, the garbagecollection management component can select a first block as the garbagecollection source block based on a number of consecutive selections of asecond block. As with the above described selection process, garbagecollection is performed in accordance with the garbage collection sourceblock selection by the garbage collection management component.

For some embodiments, the garbage collection management component tracksthe performance of a memory device over a period of time. Theperformance is sampled at certain intervals over a windowed period, anda log of the samples are stored in memory. The variation in performancecan be used as a criterion to select the first or the second garbagecollection source block.

Utilization of the above referenced approach to garbage collectionimproves memory device performance consistency by reducing the variationin the VDCs of garbage collection source blocks when hot/cold dataseparation is being conducted. As noted above, when segregating hot andcold data, frequently a cold block with high valid data count iscompacted, which creates fluctuations in the host write vs garbagecollection write ratio that can lead to inconsistencies in hostperformance. The approach described herein improves performanceconsistency by minimizing these fluctuations by selectively using thehot/cold data segregation scheme.

FIG. 1 illustrates an example computing system 100 that includes amemory sub-system 110, in accordance with some embodiments of thepresent disclosure. The memory sub-system 110 can include media, such asone or more volatile memory devices (e.g., memory device 140), one ormore non-volatile memory devices (e.g., memory device 130), or acombination of such.

A memory sub-system 110 can be a storage device, a memory module, or ahybrid of a storage device and memory module. Examples of a storagedevice include a solid-state drive (SSD), a flash drive, a universalserial bus (USB) flash drive, an embedded Multi-Media Controller (eMMC)drive, a Universal Flash Storage (UFS) drive, a secure digital (SD)card, and a hard disk drive (HDD). Examples of memory modules include adual in-line memory module (DIMM), a small outline DIMM (SO-DIMM), andvarious types of non-volatile dual in-line memory module (NVDIMM).

The computing system 100 can be a computing device such as a desktopcomputer, laptop computer, network server, mobile device, a vehicle(e.g., airplane, drone, train, automobile, or other conveyance),Internet of Things (IoT) enabled device, embedded computer (e.g., oneincluded in a vehicle, industrial equipment, or a networked commercialdevice), or such computing device that includes memory and a processingdevice.

The computing system 100 can include a host system 120 that is coupledto one or more memory sub-systems 110. In some embodiments, the hostsystem 120 is coupled to different types of memory sub-system 110. FIG.1 illustrates one example of a host system 120 coupled to one memorysub-system 110. As used herein, “coupled to” or “coupled with” generallyrefers to a connection between components, which can be an indirectcommunicative connection or direct communicative connection (e.g.,without intervening components), whether wired or wireless, includingconnections such as electrical, optical, magnetic, and the like.

The host system 120 can include a processor chipset and a software stackexecuted by the processor chipset. The processor chipset can include oneor more cores, one or more caches, a memory controller (e.g., NVDIMMcontroller), and a storage protocol controller (e.g., PCIe controller,SATA controller). The host system 120 uses the memory sub-system 110,for example, to write data to the memory sub-system 110 and read datafrom the memory sub-system 110.

The host system 120 can be coupled to the memory sub-system 110 via ahost interface. Examples of a host interface include, but are notlimited to, a serial advanced technology attachment (SATA) interface, aperipheral component interconnect express (PCIe) interface, USBinterface, Fibre Channel, Serial Attached SCSI (SAS), Small ComputerSystem Interface (SCSI), a double data rate (DDR) memory bus, a dualin-line memory module (DIMM) interface (e.g., DIMM socket interface thatsupports Double Data Rate (DDR)), Open NAND Flash Interface (ONFI),Double Data Rate (DDR), Low Power Double Data Rate (LPDDR), or any otherinterface. The host interface can be used to transmit data between thehost system 120 and the memory sub-system 110. The host system 120 canfurther utilize an NVM Express (NVMe) interface to access components(e.g., memory devices 130) when the memory sub-system 110 is coupledwith the host system 120 by the PCIe interface. The host interface canprovide an interface for passing control, address, data, and othersignals between the memory sub-system 110 and the host system 120. FIG.1 illustrates a memory sub-system 110 as an example. In general, thehost system 120 can access multiple memory sub-systems via a samecommunication connection, multiple separate communication connections,and/or a combination of communication connections.

The memory devices 130, 140 can include any combination of the differenttypes of non-volatile memory devices and/or volatile memory devices. Thevolatile memory devices (e.g., memory device 140) can be, but are notlimited to, random access memory (RAM), such as dynamic random accessmemory (DRAM) and synchronous dynamic random access memory (SDRAM).

Some examples of non-volatile memory devices (e.g., memory device 130)include negative-and (NAND) type flash memory and write-in-place memory,such as a three-dimensional cross-point (“3D cross-point”) memorydevice, which is a cross-point array of non-volatile memory cells. Across-point array of non-volatile memory can perform bit storage basedon a change of bulk resistance, in conjunction with a stackablecross-gridded data access array. Additionally, in contrast to manyflash-based memories, cross-point non-volatile memory can perform awrite in-place operation, where a non-volatile memory cell can beprogrammed without the non-volatile memory cell being previously erased.NAND type flash memory includes, for example, two-dimensional NAND (2DNAND) and three-dimensional NAND (3D NAND).

Each of the memory devices 130 can include one or more arrays of memorycells. One type of memory cell, for example, single level cells (SLC),can store one bit per cell. Other types of memory cells, such asmulti-level cells (MLCs), triple level cells (TLCs), quad-level cells(QLCs), and penta-level cells (PLCs) can store multiple bits per cell.In some embodiments, each of the memory devices 130 can include one ormore arrays of memory cells such as SLCs, MLCs, TLCs, QLCs, or anycombination of such. In some embodiments, a particular memory device caninclude an SLC portion, an MLC portion, a TLC portion, a QLC portion, ora PLC portion of memory cells. The memory cells of the memory devices130 can be grouped as pages that can refer to a logical unit of thememory device used to store data. With some types of memory (e.g.,NAND), pages can be grouped to form blocks. For example, the memorydevice can include a set of blocks. Design specifications may define aconstraint on a minimum number of valid blocks for the memory device 130that may be different from the number of blocks in the set of blocks onthe device.

Although non-volatile memory components such as NAND type flash memory(e.g., 2D NAND, 3D NAND) and 3D cross-point array of non-volatile memorycells are described, the memory device 130 can be based on any othertype of non-volatile memory, such as read-only memory (ROM), phasechange memory (PCM), self-selecting memory, other chalcogenide-basedmemories, ferroelectric transistor random-access memory (FeTRAM),ferroelectric random access memory (FeRAM), magneto random access memory(MRAM), Spin Transfer Torque (STT)-MRAM, conductive bridging RAM(CBRAM), resistive random access memory (RRAM), oxide based RRAM(OxRAM), NOR flash memory, and electrically erasable programmableread-only memory (EEPROM).

The memory sub-system controller 115 (or controller 115 for simplicity)can communicate with the memory devices 130 to perform operations suchas reading data, writing data, or erasing data at the memory devices 130and other such operations. The memory sub-system controller 115 caninclude hardware such as one or more integrated circuits and/or discretecomponents, a buffer memory, or a combination thereof. The hardware caninclude digital circuitry with dedicated (i.e., hard-coded) logic toperform the operations described herein. The memory sub-systemcontroller 115 can be a microcontroller, special purpose logic circuitry(e.g., a field programmable gate array (FPGA), an application specificintegrated circuit (ASIC), etc.), or other suitable processor.

The memory sub-system controller 115 can include a processor 117(processing device) configured to execute instructions stored in a localmemory 119. In the illustrated example, the local memory 119 of thememory sub-system controller 115 includes an embedded memory configuredto store instructions for performing various processes, operations,logic flows, and routines that control operation of the memorysub-system 110, including handling communications between the memorysub-system 110 and the host system 120.

In some embodiments, the local memory 119 can include memory registersstoring memory pointers, fetched data, and the like. The local memory119 can also include ROM for storing micro-code. While the examplememory sub-system 110 in FIG. 1 has been illustrated as including thememory sub-system controller 115, in another embodiment of the presentdisclosure, a memory sub-system 110 does not include a memory sub-systemcontroller 115, and can instead rely upon external control (e.g.,provided by an external host, or by a processor or controller separatefrom the memory sub-system).

In general, the memory sub-system controller 115 can receive commands oroperations from the host system 120 and can convert the commands oroperations into instructions or appropriate commands to achieve thedesired access to the memory devices 130 and/or the memory device 140.The memory sub-system controller 115 can be responsible for otheroperations such as wear leveling operations, garbage collectionoperations, error detection and error-correcting code (ECC) operations,encryption operations, caching operations, and address translationsbetween a logical address (e.g., logical block address (LBA), namespace)and a physical address (e.g., physical block address) that areassociated with the memory devices 130. The memory sub-system controller115 can further include host interface circuitry to communicate with thehost system 120 via the physical host interface. The host interfacecircuitry can convert the commands received from the host system 120into command instructions to access the memory devices 130 and/or thememory device 140 and convert responses associated with the memorydevices 130 and/or the memory device 140 into information for the hostsystem 120.

In some embodiments, the memory devices 130 include local mediacontroller 135 that operate in conjunction with memory sub-systemcontroller 115 to execute operations on one or more memory cells of thememory devices 130 and 140.

The memory sub-system 110 also includes a garbage collection managementcomponent 113 that is responsible for managing garbage collectionprocesses within the memory sub-system 110. As part of managing garbagecollection within the memory sub-system 110, the garbage collectionmanagement component 113 selects, for each garbage collection cycle, agarbage collection source block from among blocks of the memory devices130 and 140. At each garbage collection cycle, the garbage collectionmanagement component 113 utilizes multiple garbage collection schemes toselect multiple candidates for the garbage collection source block andselects one of the blocks as the garbage collection source block basedon a comparison of the candidates in accordance with one or morecomparison criterion. Further details regarding garbage collectionsource block selection by the garbage collection management component113 are discussed below.

In some embodiments, the memory sub-system controller 115 includes atleast a portion of the garbage collection management component 113. Forexample, the memory sub-system controller 115 can include a processor117 (processing device) configured to execute instructions stored inlocal memory 119 for performing the operations described herein. In someembodiments, the garbage collection management component 113 is part ofthe host system 120, an application, or an operating system. In someembodiments, the local media controller 135 includes at least a portionof the garbage collection management component 113.

FIGS. 2A and 2B are conceptual diagrams illustrating exampleinteractions between components of the memory sub-system in performing amethod for selecting a garbage collection source block to controlvariation in valid data counts, in accordance with some embodiments ofthe present disclosure.

In the example illustrated, memory device 202 is an example memorydevice 130 in the example form of a NAND memory device includingmultiple memory blocks (e.g., memory block 204). A NAND memory block 204includes a two-dimensional (2-D) array including pages (rows) andstrings (columns). A three-dimensional (3D) NAND-type flash memorydevice includes multiple planes, each of which includes a set of memoryblocks 204. A string includes a plurality of memory cells connected inseries. Each memory cell is used to represent one or more bit values. Asingle NAND flash cell includes a transistor that stores an electriccharge on a memory layer that is isolated by oxide insulating layersabove and below.

As shown in FIG. 2A, at operation 206, the garbage collection managementcomponent 113 determines a VDC for each block 204 in the memory device202. The VDC of a block refers to a number of pages in the block thatstore valid data. Based on the determined VDCs of the blocks 204, thegarbage collection management component 113 identifies a subset ofblocks 204 that satisfy a VDC constraint that specifies a VDC threshold(operation 208). A block 204 with a VDC that is below the VDC thresholdsatisfies the VDC constraint. Accordingly, the garbage collectionmanagement component 113 identifies a subset of blocks 204 that have aVDC that is lower than the VDC threshold.

From the subset of blocks 204, the garbage collection managementcomponent 113 uses a first garbage collection scheme to select a firstblock as a first candidate garbage collection source block (operation210) and uses a second garbage collection scheme to select a secondblock as a second candidate garbage collection source block (operation212). For some embodiments, the first garbage collection scheme resultsin selection of the block 204 with the lowest VDC among the subset ofblocks 204 (also referred to as the “minimum VDC” of the memory device202), and the second garbage collection scheme results in selection of ablock 204 based on a combination of data temperature and VDC. The datatemperature of a block refers to a frequency with which data stored bythe block is updated. As an example of the second garbage collectionscheme, the garbage collection management component 113 may calculate ascore for each block 204 in the subset based on any one or more of: datatemperature, VDC, one or more identifiers given by the host system, atotal number of blocks containing data of certain temperature, an amountof host traffic of data with a certain temperature, and number ofprogram/erase cycles performed at the block, and select the block withthe lowest score.

The garbage collection management component 113 compares the first blockand the second block, at operation 214, and selects either the firstblock or the second block as the garbage collection source block, atoperation 216. The garbage collection management component 113 canutilize one or more comparison criterion for comparing the first andsecond block and selecting a garbage collection source block. In anexample, the garbage collection management component 113 applies aweighting factor based on the one or more comparison criterion to theVDC of the first block and compares the weighted VDC of the first blockwith a VDC of the second block. If the VDC of the second block isgreater than the weighted VDC value, the garbage collection managementcomponent 113 selects the first block (e.g., the block with the lowestVDC) as the garbage collection source block. If the VDC of the secondblock is equal to or less than the weighted VDC, the garbage collectionmanagement component 113 selects the second block as the garbagecollection source block. The garbage collection is thereafter performedin accordance with the garbage collection source block selection.

The garbage collection management component 113 may repeat the garbagecollection source block selection process described above at eachgarbage collection cycle, and as shown in FIG. 2B, the garbagecollection management component 113 tracks each garbage collectionsource block selection, at operation 250. That is, the garbagecollection management component 113 tracks which block is selected asthe garbage collection source block at each garbage collection cyclealong with the garbage collection scheme used to select the blockselected as the garbage collection source block. At operation 252, thegarbage collection management component 113 generates and storeshistorical log data based on the tracking. The historical log dataincludes an indication of which block was selected at each garbagecollection source block selection. For some embodiments, the garbagecollection management component 113 tracks only a subset of garbagecollection source block selections. For example, the garbage collectionmanagement component 113 may track only selections of blocks with a VDCthat is within a predefined range of a minimum VDC in the memory device202.

The garbage collection management component 113 can use the historicallog data as a basis for garbage collection source block selection forsubsequent iterations of garbage collection (at operation 254). Forexample, the garbage collection management component 113 can select agarbage collection source block based on a number of consecutive garbagesource block selections of the same block. That is, with returnedreference to the first and second blocks discussed above in reference toFIG. 2A, if the number of consecutive selections of the first block asthe garbage collection source block exceeds a predefined thresholdnumber of consecutive selections, the processing device may select thesecond block as the garbage collection source block. Visa versa, if thenumber of consecutive selections of the second block as the garbagecollection source block exceeds the predefined threshold number ofconsecutive selections, the processing device may select the first blockas the garbage collection source block. As with the process describedabove, the garbage collection is performed in accordance with thegarbage collection source block selected by the garbage collectionmanagement component 113.

FIGS. 3 and 4 are flow diagrams illustrating a method for selecting agarbage collection source block that controls variation in valid datacounts, in accordance with some embodiments of the present disclosure.The method 300 can be performed by processing logic that can includehardware (e.g., a processing device, circuitry, dedicated logic,programmable logic, microcode, hardware of a device, an integratedcircuit, etc.), software (e.g., instructions run or executed on aprocessing device), or a combination thereof. In some embodiments, themethod 300 is performed by the garbage collection management component113 of FIG. 1 . Although processes are shown in a particular sequence ororder, unless otherwise specified, the order of the processes can bemodified. Thus, the illustrated embodiments should be understood only asexamples, and the illustrated processes can be performed in a differentorder, and some processes can be performed in parallel. Additionally,one or more processes can be omitted in various embodiments. Thus, notall processes are required in every embodiment. Other process flows arepossible.

The method 300 begins at operation 305 where the processing devicedetermines a VDC for each block of a memory device (e.g., the memorydevice 130). As previously noted, a VDC of a block indicates a number ofpages in a block that store valid data.

At operation 310, the processing device identifies a subset of blocks inthe memory device that satisfy a VDC constraint based on the VDCsdetermined for each block in the memory device. The VDC constraintcomprises a threshold VDC. In determining whether a given blocksatisfies the VDC constraint, the processing device determines whetherthe VDC of the block is below the threshold VDC.

The processing device stores identifiers of each block in the identifiedsubset in a table or other data structure in memory (e.g., local memory119), at operation 315. For each block, the processing device mayfurther store the VDC of the block.

At operation 320, the processing device selects, using a first garbagecollection scheme, a first block from the subset based on the VDC of thefirst block. In the first garbage collection scheme, the block with thelowest VDC is selected. Hence, the first block selected by theprocessing device using the first garbage collection scheme is the blockin the subset identified by the processing device as having the lowestVDC of blocks in the subset.

The processing device, at operation 325, selects, using a second garbagecollection scheme, a second block from the subset based in part on adata temperature of the second block. As previously noted, the datatemperature of a block refers to a frequency with which data stored bythe block is updated. For some embodiments, garbage source blockselection using the second garbage collection scheme includescalculating a score for each block based on a combination of a givenblock's data temperature, VDC, and number of program/erase cyclesperformed at the block. For example, let V denote the VDC of a block, Pdenote the number of program/erase cycles performed at a block, and Tdenote the data temperature of the block. In this example, the score Sof a block is:

-   -   S=f(V, P, T, . . . )        For these embodiments, the block in the subset with the lowest        score S is selected based on the second garbage collection        scheme.

At operation 330, the processing device performs a comparison of thefirst block selected using the first garbage collection scheme with thesecond block selected using the second garbage collection scheme inaccordance with one or more comparison criterion. The processing deviceselects a garbage collection source block based on the comparison, atoperation 335. That is, the processing device selects either the firstblock or the second block as the garbage collection source block basedon the comparison. The processing device performs garbage collection atthe garbage collection source block, at operation 340.

As shown in FIG. 4 , the method 300 may, in some embodiments, includeoperations 405, 410, and 415. Consistent with these embodiments, theoperations 405 and 410 can be performed as part of the operation 330where the processing device performs a comparison of the first blockselected using the first garbage collection scheme with the second blockselected using the second garbage collection scheme. At operation 405,the processing device applies a weighting factor to the VDC of the firstblock (the lowest VDC in the subset of blocks with a VDC below the VDCthreshold) based on the one or more comparison criterion. Theapplication of the weighting factor to the VDC of the first blockresults in a weighted VDC. As an example with V denoting the VDC of thefirst block, the processing device can apply a weighting factor γresulting in a weighted VDC of γV. The processing device compares theweighted VDC value with a VDC of the second block selected using thesecond garbage collection scheme, at operation 410.

Consistent with these embodiments, the operation 415 can be performed aspart of operation 335 where the processing device selects the garbagecollection source block. At operation 415, the processing device selectseither the first or second block as the garbage collection source blockbased on the comparison of the weighted VDC value with the VDC of thesecond block. If the VDC of the second block is greater than theweighted VDC value (e.g., >γV), the processing device selects the firstblock (e.g., the block with the lowest VDC) as the garbage collectionsource block. If the VDC of the second block is equal to or less thanthe weighted VDC (e.g., ≤γV), the processing device selects the secondblock as the garbage collection source block. The weight γ can bedynamically adjusted according to a historical log of the garbagecollection source block VDCs or a historical log of memory deviceperformance.

For some embodiments, blocks in the memory device can be sorted based onscore S in ascending order (from lowest score to highest). Consistentwith these embodiments, if the VDC of the second block is greater thanthe weighted VDC value (e.g., >γV), the processing device selects theblock with the second highest score S, and compares the weighted VDCwith the first block again. This process continues for some limitediterations until a block is found with a VDC that is less than theweighted VDC value of the first block. If no such block is found, theprocessing device selects the first block as the garbage collectionsource block.

FIG. 5 is a flow diagram illustrating a method 500 for selecting agarbage collection source block that controls variation in valid datacounts, in accordance with some embodiments of the present disclosure.The method 500 can be performed by processing logic that can includehardware (e.g., a processing device, circuitry, dedicated logic,programmable logic, microcode, hardware of a device, an integratedcircuit, etc.), software (e.g., instructions run or executed on aprocessing device), or a combination thereof. In some embodiments, themethod 500 is performed by the garbage collection management component113 of FIG. 1 . Although processes are shown in a particular sequence ororder, unless otherwise specified, the order of the processes can bemodified. Thus, the illustrated embodiments should be understood only asexamples, and the illustrated processes can be performed in a differentorder, and some processes can be performed in parallel. Additionally,one or more processes can be omitted in various embodiments. Thus, notall processes are required in every embodiment. Other process flows arepossible.

At operation 505, the processing device tracks multiple garbagecollection source block selections for a memory device (e.g., memorydevice 130). Garbage collection source block selection refers to aprocess of selecting a block in the memory device as the garbagecollection source block. For some embodiments, a garbage collectionsource block selection corresponds to the operation 335 described abovewith reference to method 300. Consistent with these embodiments, themethod 300 may be repeatedly performed, and the processing devicemonitors which block is selected at operation 335 at each iteration.

At operation 510, the processing device tracks historical performance ofthe memory device. In tracking the historical performance of the memorydevice, the processing device may obtain routine measurements related toany one or more of: a throughput (or bandwidth) of the memory devicemeasured at predetermined time periods; consistency of throughput (orvariation in bandwidth); and quality of service (distribution of thelatency of each host command request).

The processing at operation 515, generates historical log data based onthe tracking of garbage collection source block selection and historicalperformance of the memory device. Hence, the historical log dataincludes garbage collection source block selection log data and memorydevice performance log data. The garbage collection source blockselection log data includes an indication of which block was selected ateach garbage collection source block selection. For some embodiments,the processing device tracks a subset of garbage collection source blockselections. In these embodiments, the subset of garbage collectionsource block selections correspond to blocks with a VDC that is within apredefined range of a minimum VDC in the memory device. For example, theprocessing device may track and generate log data for blocks with a VDCthat is in a predefined range of the block selected by the first garbagecollection scheme (e.g., the first block referenced in the descriptionof the method 300). The memory device performance log data may, forexample, comprise one or more of: a measure of throughput (or bandwidth)of the memory device measured at each time period; a measure ofconsistency of the throughput (or variation in bandwidth) among the timeperiods; and a measure of quality of service at each time period.

The processing device selects, at operation 520, a garbage collectionsource block based on the historical log data. For example, theprocessing device may select a first block using the first garbagecollection scheme, select a second block using the second garbagecollection scheme in accordance with the description above in referenceto method 300, and select either the first block or the second block asthe garbage collection source block based on the historical log data.For some examples, the processing device selects the garbage collectionsource block based on a number of consecutive garbage source blockselections of the same block. That is, if the number of consecutiveselections of the first block as the garbage collection source blockexceeds a predefined threshold number of consecutive selections, theprocessing device may select the second block as the garbage collectionsource block (at operation 520). Visa versa, if the number ofconsecutive selections of the second block as the garbage collectionsource block exceeds the predefined threshold number of consecutiveselections, the processing device may select the first block as thegarbage collection source block (at operation 520). The processingdevice performs garbage collection in accordance with the garbagecollection source block selection, at operation 525.

For some embodiments, the processing device may adjust the weight γ(discussed above in reference to FIG. 4 ) based on the historical logdata. The garbage collection source blocks scores produced by the secondgarbage collection scheme can be sorted, and the first block (within amaximum range of blocks) that satisfies the weighted VDC comparison maybe selected. If no such block exists, the processing device selects theblock identified by the first garbage collection scheme as the garbagecollection source block.

Described implementations of the subject matter can include one or morefeatures, alone or in combination as illustrated below by way ofexample.

-   -   Example 1 is a memory sub-system comprising: a memory device        comprising a set of blocks; and a processing device, operatively        coupled with the memory device, to perform operations        comprising: identifying a subset of blocks from the set of        blocks based on a valid data count constraint; selecting, using        a first garbage collection source block selection scheme, a        first block from the subset of blocks based on a valid data        count of the first block, the valid data count of the first        block comprising a number of pages in the block that store valid        data; selecting, using a second garbage collection source block        selection scheme, a second block from the subset of blocks based        on a data temperature of the second block, the data temperature        of the second block corresponding to a frequency with which data        stored by the second block is updated; performing a comparison        of the first block and the second block in accordance with one        or more comparison criterion; selecting the first block or the        second block as a garbage collection source block based on the        comparison; and performing garbage collection at the garbage        collection source block.    -   Example 2 includes the system of Example 1, wherein: the valid        data count constraint comprises a valid data count threshold;        and the identifying of the subset of blocks comprises        identifying one or more blocks with a valid data count that is        below the valid data count threshold.    -   Example 3 includes the system of any one or more of Examples 1        or 2, wherein the operations further comprise: determining a        valid data count for each block in the set of blocks.    -   Example 4 includes the system of any one or more of Examples        1-3, wherein the operations further comprise storing, in memory,        a set of identifiers corresponding to the subset of blocks,        wherein the selecting of the first block and the second block        comprises accessing the set of identifiers.    -   Example 5 includes the system of any one or more of Examples        1-4, wherein the selecting of the first block comprises        selecting a block with a lowest valid data count among the        subset of blocks.    -   Example 6 includes the system of any one or more of Examples        1-5, wherein the selecting of the second block from the subset        comprises: determining a score for the second block based on a        combination of the data temperature of the second block, a        number of program/erase cycles performed at the second block,        and a valid data count for the second block; and selecting the        second block from the subset of blocks based on the score for        the second block being the lowest among a set of scores        corresponding to the subset of blocks.    -   Example 7 includes the system of any one or more of Examples        1-6, wherein performing the comparison of the first block and        the second block in accordance with the one or more comparison        criterion comprises: applying a weight to the valid data count        of the first block based on the one or more comparison        criterion, the applying of the weight to the valid data count        resulting in a weighted valid data count; comparing the weighted        valid data count corresponding to the first block with a valid        data count of the second block; and selecting the garbage        collection source block based on comparing the weighted valid        data count corresponding to the first block with the valid data        count of the second block.    -   Example 8 includes the system of any one or more of Examples        1-7, wherein: the garbage collection source block is a first        garbage collection source block; further comprising: tracking        multiple garbage collection source block selections; generating        log data based on the tracking, the log data indicating which        block was selected at each garbage collection source block        selection; and selecting a second garbage collection source        block based on the log data, the second garbage collection        source block being different than the first garbage collection        source block.    -   Example 9 includes the system of any one or more of Examples        1-8, wherein the multiple garbage collection selections        correspond to blocks with a valid data count that is within a        predefined range of the valid data count of the first block.    -   Example 10 includes the system of any one or more of Examples        1-9, wherein the selecting of the second garbage collection        source block is based on a number of consecutive garbage        collection source block selections corresponding to the first        garbage collection source block.    -   Example 11 is a method comprising: identifying, by a processing        device, a subset of blocks from a set of blocks of a memory        device based on a valid data count constraint; selecting, using        a first garbage collection source block selection scheme, a        first block from the subset of blocks based on a valid data        count of the first block, the valid data count of the first        block comprising a number of pages in the block that store valid        data; selecting, using a second garbage collection source block        selection scheme, a second block from the subset of blocks based        on a data temperature of the second block, the data temperature        of the second block corresponding to a frequency with which data        stored by the second block is updated; performing, by the        processing device, a comparison of the first block and the        second block in accordance with one or more comparison        criterion; selecting, by the processing device, the first block        or the second block as a garbage collection source block based        on the comparison; and performing garbage collection at the        garbage collection source block.    -   Example 12 includes the method of Example 11, wherein: the valid        data count constraint comprises a valid data count threshold;        and the identifying of the subset of blocks comprises        identifying one or more blocks with a valid data count that is        below the valid data count threshold.    -   Example 13 includes the method of any one or more of Examples 11        or 12, further comprising determining a valid data count for        each block in the set of blocks.    -   Example 14 includes the method of any one or more of Examples        11-13, further comprising storing, in memory, a set of        identifiers corresponding to the subset of blocks, wherein the        selecting of the first block and the second block comprise        accessing the set of identifiers.    -   Example 15 includes the method of any one or more of Examples        11-14, wherein the selecting of the first block comprises        selecting a block with a lowest valid data count among the        subset of blocks.    -   Example 16 includes the method of any one or more of Examples        11-15, wherein the selecting of the second block from the subset        comprises: determining a score for the second block based on a        combination of the data temperature of the second block, a        number of program/erase cycles performed at the second block,        and a valid data count for the second block; and selecting the        second block from the subset of blocks based on the score for        the second block being the lowest among a set of scores        corresponding to the subset of blocks.    -   Example 17 includes the method of any one or more of Examples        11-16, wherein performing the comparison of the first block and        the second block in accordance with the one or more comparison        criterion comprises: applying a weight to the valid data count        of the first block based on the one or more comparison        criterion, the applying of the weight to the valid data count        resulting in a weighted valid data count; comparing the weighted        valid data count corresponding to the first block with a valid        data count of the second block; and selecting the garbage        collection source block based on comparing the weighted valid        data count corresponding to the first block with the valid data        count of the second block.    -   Example 18 includes the method of any one or more of Examples        11-17, wherein: the garbage collection source block is a first        garbage collection source block; further comprising: tracking        multiple garbage collection source block selections; generating        historical log data based on the tracking, the historical log        data indicating which block was selected at each garbage        collection source block selection; and selecting a second        garbage collection source block based on the historical log        data, the second garbage collection source block being different        than the first garbage collection source block.    -   Example 19 includes the method of any one or more of Examples        11-18, wherein the garbage collection source block is a first        garbage collection source block; and further comprising:        tracking performance of the memory device; generating log data        based on the tracking of the performance of the memory device,        the log data comprising one or more of: a measure of throughput        of the memory device at one or more time periods; a measure of        bandwidth of the memory device, a measure of consistency of the        throughput among the one or more time periods; a measure of        variation in bandwidth among the one or more time periods; and a        measure of the quality of service at the one or more time        periods; and selecting a second garbage collection source block        based on the log data.    -   Example 20 is a non-transitory computer-readable storage medium        comprising instructions that, when executed by a processing        device, configure the processing device to perform operations        comprising: identifying a subset of blocks from a set of blocks        of a memory device based on a valid data count constraint;        selecting, using a first garbage collection source block        selection scheme, a first block from the subset of blocks based        on a valid data count of the first block, the valid data count        of the first block comprising a number of pages in the block        that store valid data; selecting, using a second garbage        collection source block selection scheme, a second block from        the subset of blocks based on a data temperature of the second        block, the data temperature of the second block corresponding to        a frequency with which data stored by the second block is        updated; performing a comparison of the first block and the        second block in accordance with one or more comparison        criterion; selecting the first block or the second block as a        garbage collection source block based on the comparison; and        performing garbage collection at the garbage collection source        block.

FIG. 6 illustrates an example machine in the form of a computer system600 within which a set of instructions can be executed for causing themachine to perform any one or more of the methodologies discussedherein. In some embodiments, the computer system 600 can correspond to ahost system (e.g., the host system 120 of FIG. 1 ) that includes, iscoupled to, or utilizes a memory sub-system (e.g., the memory sub-system110 of FIG. 1 ) or can be used to perform the operations of a controller(e.g., to execute an operating system to perform operationscorresponding to the garbage collection management component 113 of FIG.1 ). In alternative embodiments, the machine can be connected (e.g.,networked) to other machines in a local area network (LAN), an intranet,an extranet, and/or the Internet. The machine can operate in thecapacity of a server or a client machine in client-server networkenvironment, as a peer machine in a peer-to-peer (or distributed)network environment, or as a server or a client machine in a cloudcomputing infrastructure or environment.

The machine can be a personal computer (PC), a tablet PC, a set-top box(STB), a Personal Digital Assistant (PDA), a cellular telephone, a webappliance, a server, a network router, a switch or bridge, or anymachine capable of executing a set of instructions (sequential orotherwise) that specify actions to be taken by that machine. Further,while a single machine is illustrated, the term “machine” shall also betaken to include any collection of machines that individually or jointlyexecute a set (or multiple sets) of instructions to perform any one ormore of the methodologies discussed herein.

The example computer system 600 includes a processing device 602, a mainmemory 604 (e.g., ROM, flash memory, DRAM such as SDRAM or RDRAM, etc.),a static memory 606 (e.g., flash memory, static random access memory(SRAM), etc.), and a data storage system 618, which communicate witheach other via a bus 630.

Processing device 602 represents one or more general-purpose processingdevices such as a microprocessor, a central processing unit, or thelike. More particularly, the processing device 602 can be a complexinstruction set computing (CISC) microprocessor, reduced instruction setcomputing (RISC) microprocessor, very long instruction word (VLIW)microprocessor, or a processor implementing other instruction sets, orprocessors implementing a combination of instruction sets. Processingdevice 602 can also be one or more special-purpose processing devicessuch as an ASIC, a FPGA, a digital signal processor (DSP), networkprocessor, or the like. The processing device 602 is configured toexecute instructions 626 for performing the operations and stepsdiscussed herein. The computer system 600 can further include a networkinterface device 608 to communicate over a network 620.

The data storage system 618 can include a machine-readable storagemedium 624 (also known as a computer-readable medium) on which is storedone or more sets of instructions 626 or software embodying any one ormore of the methodologies or functions described herein. Theinstructions 626 can also reside, completely or at least partially,within the main memory 604 and/or within the processing device 602during execution thereof by the computer system 600, the main memory 604and the processing device 602 also constituting machine-readable storagemedia. The machine-readable storage medium 624, data storage system 618,and/or main memory 604 can correspond to the memory sub-system 110 ofFIG. 1 .

In one embodiment, the instructions 626 include instructions toimplement functionality corresponding to a data destruction component(e.g., the garbage collection management component 113 of FIG. 1 ).While the machine-readable storage medium 624 is shown in an exampleembodiment to be a single medium, the term “machine-readable storagemedium” should be taken to include a single medium or multiple mediathat store the one or more sets of instructions. The term“machine-readable storage medium” shall also be taken to include anymedium that is capable of storing or encoding a set of instructions forexecution by the machine and that cause the machine to perform any oneor more of the methodologies of the present disclosure. The term“machine-readable storage medium” shall accordingly be taken to include,but not be limited to, solid-state memories, optical media, and magneticmedia.

Some portions of the preceding detailed descriptions have been presentedin terms of algorithms and symbolic representations of operations ondata bits within a computer memory. These algorithmic descriptions andrepresentations are the ways used by those skilled in the dataprocessing arts to convey the substance of their work most effectivelyto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of operations leading to adesired result. The operations are those requiring physicalmanipulations of physical quantities. Usually, though not necessarily,these quantities take the form of electrical or magnetic signals capableof being stored, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. The presentdisclosure can refer to the action and processes of a computer system,or similar electronic computing device, that manipulates and transformsdata represented as physical (electronic) quantities within the computersystem's registers and memories into other data similarly represented asphysical quantities within the computer system memories or registers orother such information storage systems.

The present disclosure also relates to an apparatus for performing theoperations herein. This apparatus can be specially constructed for theintended purposes, or it can include a general-purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program can be stored in a computerreadable storage medium, such as, but not limited to, any type of diskincluding floppy disks, optical disks, CD-ROMs, and magnetic-opticaldisks, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, or anytype of media suitable for storing electronic instructions, each coupledto a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general-purposesystems can be used with programs in accordance with the teachingsherein, or it can prove convenient to construct a more specializedapparatus to perform the method. The structure for a variety of thesesystems will appear as set forth in the description below. In addition,the present disclosure is not described with reference to any particularprogramming language. It will be appreciated that a variety ofprogramming languages can be used to implement the teachings of thedisclosure as described herein.

The present disclosure can be provided as a computer program product, orsoftware, that can include a machine-readable medium having storedthereon instructions, which can be used to program a computer system (orother electronic devices) to perform a process according to the presentdisclosure. A machine-readable medium includes any mechanism for storinginformation in a form readable by a machine (e.g., a computer). In someembodiments, a machine-readable (e.g., computer-readable) mediumincludes a machine (e.g., a computer) readable storage medium such as aROM, RAM, magnetic disk storage media, optical storage media, flashmemory components, etc.

In the foregoing specification, embodiments of the disclosure have beendescribed with reference to specific example embodiments thereof. Itwill be evident that various modifications can be made thereto withoutdeparting from the broader scope of embodiments of the disclosure as setforth in the following claims. The specification and drawings are,accordingly, to be regarded in an illustrative sense rather than arestrictive sense.

What is claimed is:
 1. A memory sub-system comprising: a memory devicecomprising a set of blocks; and a processing device, operatively coupledwith the memory device, to perform operations comprising: identifying asubset of blocks from the set of blocks based on a valid data countconstraint; selecting, using a first garbage collection source blockselection scheme, a first block from the subset of blocks based on avalid data count of the first block, the valid data count of the firstblock comprising a number of pages in the block that store valid data;selecting, using a second garbage collection source block selectionscheme, a second block from the subset of blocks based on a datatemperature of the second block, the data temperature of the secondblock corresponding to a frequency with which data stored by the secondblock is updated; performing a comparison of the first block and thesecond block in accordance with one or more comparison criterion;selecting the first block or the second block as a garbage collectionsource block based on the comparison; and performing garbage collectionat the garbage collection source block.
 2. The memory sub-system ofclaim 1, wherein: the valid data count constraint comprises a valid datacount threshold; and the identifying of the subset of blocks comprisesidentifying one or more blocks with a valid data count that is below thevalid data count threshold.
 3. The memory sub-system of claim 2, whereinthe operations further comprise: determining a valid data count for eachblock in the set of blocks.
 4. The memory sub-system of claim 1, whereinthe operations further comprise storing, in memory, a set of identifierscorresponding to the subset of blocks, wherein the selecting of thefirst block and the second block comprise accessing the set ofidentifiers.
 5. The memory sub-system of claim 1, wherein the selectingof the first block comprises selecting a block with a lowest valid datacount among the subset of blocks.
 6. The memory sub-system of claim 1,wherein the selecting of the second block from the subset comprises:determining a score for the second block based on a combination of thedata temperature of the second block, a number of program/erase cyclesperformed at the second block, and a valid data count for the secondblock; and selecting the second block from the subset of blocks based onthe score for the second block being a lowest among a set of scorescorresponding to the subset of blocks.
 7. The memory sub-system of claim1, wherein performing the comparison of the first block and the secondblock in accordance with the one or more comparison criterion comprises:applying a weight to the valid data count of the first block based onthe one or more comparison criterion, the applying of the weight to thevalid data count resulting in a weighted valid data count; comparing theweighted valid data count corresponding to the first block with a validdata count of the second block; and selecting the garbage collectionsource block based on comparing the weighted valid data countcorresponding to the first block with the valid data count of the secondblock.
 8. The memory sub-system of claim 1, wherein: the garbagecollection source block is a first garbage collection source block;further comprising: tracking multiple garbage collection source blockselections; generating historical log data based on the tracking, thehistorical log data indicating which block was selected at each garbagecollection source block selection; and selecting a second garbagecollection source block based on the historical log data, the secondgarbage collection source block being different than the first garbagecollection source block.
 9. The memory sub-system of claim 8, whereinthe multiple garbage collection selections correspond to blocks with avalid data count that is within a predefined range of the valid datacount of the first block.
 10. The memory sub-system of claim 8, whereinthe selecting of the second garbage collection source block is based ona number of consecutive garbage collection source block selectionscorresponding to the first garbage collection source block.
 11. A methodcomprising: identifying, by a processing device, a subset of blocks froma set of blocks of a memory device based on a valid data countconstraint; selecting, using a first garbage collection source blockselection scheme, a first block from the subset of blocks based on avalid data count of the first block, the valid data count of the firstblock comprising a number of pages in the block that store valid data;selecting, using a second garbage collection source block selectionscheme, a second block from the subset of blocks based on a datatemperature of the second block, the data temperature of the secondblock corresponding to a frequency with which data stored by the secondblock is updated; performing, by the processing device, a comparison ofthe first block and the second block in accordance with one or morecomparison criterion; selecting, by the processing device, the firstblock or the second block as a garbage collection source block based onthe comparison; and performing garbage collection at the garbagecollection source block.
 12. The method of claim 11, wherein: the validdata count constraint comprises a valid data count threshold; and theidentifying of the subset of blocks comprises identifying one or moreblocks with a valid data count that is below the valid data countthreshold.
 13. The method of claim 12, further comprising determining avalid data count for each block in the set of blocks.
 14. The method ofclaim 11, further comprising storing, in memory, a set of identifierscorresponding to the subset of blocks, wherein the selecting of thefirst block and the second block comprise accessing the set ofidentifiers.
 15. The method of claim 11, wherein the selecting of thefirst block comprises selecting a block with a lowest valid data countamong the subset of blocks.
 16. The method of claim 11, wherein theselecting of the second block from the subset comprises: determining ascore for the second block based on a combination of the datatemperature of the second block, a number of program/erase cyclesperformed at the second block, and a valid data count for the secondblock; and selecting the second block from the subset of blocks based onthe score for the second block being a lowest among a set of scorescorresponding to the subset of blocks.
 17. The method of claim 11,wherein performing the comparison of the first block and the secondblock in accordance with the one or more comparison criterion comprises:applying a weight to the valid data count of the first block based onthe one or more comparison criterion, the applying of the weight to thevalid data count resulting in a weighted valid data count; comparing theweighted valid data count corresponding to the first block with a validdata count of the second block; and selecting the garbage collectionsource block based on comparing the weighted valid data countcorresponding to the first block with the valid data count of the secondblock.
 18. The method of claim 11, wherein: the garbage collectionsource block is a first garbage collection source block; furthercomprising: tracking multiple garbage collection source blockselections; generating historical log data based on the tracking, thehistorical log data indicating which block was selected at each garbagecollection source block selection; and selecting a second garbagecollection source block based on the historical log data, the secondgarbage collection source block being different than the first garbagecollection source block.
 19. The method of claim 11, wherein: thegarbage collection source block is a first garbage collection sourceblock; further comprising: tracking performance of the memory device;generating historical log data based on the tracking of the performanceof the memory device, the historical log data comprising one or more of:a measure of throughput of the memory device at one or more timeperiods; a measure of bandwidth of the memory device; a measure ofconsistency of the throughput among the one or more time periods; ameasure of variation in bandwidth among the one or more time periods;and a measure of a quality of service at the one or more time periods;and selecting a second garbage collection source block based on thehistorical log data.
 20. A non-transitory computer-readable storagemedium comprising instructions that, when executed by a processingdevice, configure the processing device to perform operationscomprising: identifying a subset of blocks from a set of blocks of amemory device based on a valid data count constraint; selecting, using afirst garbage collection source block selection scheme, a first blockfrom the subset of blocks based on a valid data count of the firstblock, the valid data count of the first block comprising a number ofpages in the block that store valid data; selecting, using a secondgarbage collection source block selection scheme, a second block fromthe subset of blocks based on a data temperature of the second block,the data temperature of the second block corresponding to a frequencywith which data stored by the second block is updated; performing acomparison of the first block and the second block in accordance withone or more comparison criterion; selecting the first block or thesecond block as a garbage collection source block based on thecomparison; and performing garbage collection at the garbage collectionsource block.